//
//  ChatTextView.h
//  聊天输入框
//
//  Created by maple on 15/1/30.
//  Copyright (c) 2015年 maple. All rights reserved.
//

#import <UIKit/UIKit.h>
#define BottomViewTag 10101



@class ChatTextView;

@protocol ChatTextViewDelegate <NSObject>

@optional
//emojiView相关的
/**
 * 删除表情或其它－－
 *
 *  @param chatTextView
 *  @param text
 */
- (void)emojiChatViewDidDelete:(ChatTextView *)chatTextView deleteStr:(NSString *)text;
/**
 *  选中某个表情
 *
 *  @param chatTextView
 *  @param text         
 */
- (void)emojiChatViewDidSelect:(ChatTextView *)chatTextView selectStr:(NSString *)text;

// 即将输入
- (void)chatTextViewShouldEditing:(ChatTextView *)chatTextView;

// 点击了发送按钮
- (void)chatTextView:(ChatTextView *)chatTextView sendMessage:(NSString *)text;

// 录音按钮按住
- (void)chatTextViewBeginRecord:(ChatTextView *)chatTextView;
// 录音按钮松开
- (void)chatTextViewEndRecord:(ChatTextView *)chatTextView;
//录音取消
- (void)chatTextViewCancleEndRecord:(ChatTextView *)chatTextView;




// 打开相册或拍照
- (void)chatTextView:(ChatTextView *)chatTextView openCameraOrAlbum:(UIButton *)media;
/**
 *  打开 相册或拍照
 *
 *  @param chatTextView
 *  @param tag          0 是照片 1 是拍照
 */
- (void)chatTextView:(ChatTextView *)chatTextView openCameraOrAlbumTag:(NSInteger)tag;
/**
 *  小视频
 *
 *  @param chatTextView
 */
- (void)chatTextSmallVideoView:(ChatTextView *)chatTextView;
/**
 *  语音聊天
 *
 *  @param chatTextView
 */
- (void)chatTextVoiceView:(ChatTextView *)chatTextView;
/**
 *  收藏事件
 *
 *  @param chatTextView
 */
- (void)chatTextCollectListView:(ChatTextView *)chatTextView;


// 请求视频
- (void)chatTextViewRequestVideoChat:(ChatTextView *)chatTextView;






@end

#define TextViewHeight 44


@interface ChatTextView : UIImageView

// 录音按钮
@property (nonatomic, strong) UIButton *recordBtn;

// 加号按钮
@property (nonatomic, strong) UIButton *addBtn;
@property (nonatomic,strong)UIButton *emojButton;//表情按钮

@property (nonatomic, weak) id<ChatTextViewDelegate> delegate;

@property (nonatomic, assign) BOOL isFirstResponder;

@property (nonatomic, assign) CGFloat currentHeight;

// 在控制器中下去
//- (void)getDown;

- (void)resignFirstResponder;

- (void)becomeFirstResponder;

/**
 *  隐藏textview
 */
- (void)hideSelfTextView;
@end
